package com.andnnl.redis;

import redis.clients.jedis.BinaryJedisPubSub;
import redis.clients.jedis.JedisPubSub;

import java.util.List;
import java.util.Map;

/**
 * Created by chenss on 2020/8/29.
 */
public interface IRedisService {
    String get(String key);

    String set(String key, Object value);

    String set(String key, Object value, Integer seconds);

    boolean existsKey(String key);

    Long del(String key);

    void destroy();

    void lpush(String key, String val);

    void expire(String key, int seconds);

    List lrange(String key, int start, int stop);

    Long hset(String key, String field, String value);

    String hget(String key, String field);

    Map<String, String> hgetAll(String key);

    long incr(String key);

    long incrBy(String key, long field);

    long decr(String key);

    long decrBy(String key, long field);

    long ttl(String key);

    Long publish(String key, String value);

    Long publish(byte[] key, byte[] value);

    void subscribe(JedisPubSub jedisPubSub, String... channels);

    void subscribe(BinaryJedisPubSub jedisPubSub, byte[]... channels);

    void psubscribe(JedisPubSub jedisPubSub, String... patterns);

    void psubscribe(BinaryJedisPubSub jedisPubSub, byte[]... patterns);
}
